using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MA_ReadAngels_Renew : MonoBehaviour
{
    public GameObject ma_RunningTestPanel;
    Running_TestPanel_Renew running_TestPanel_Renew;

    private int sequenceLenght; // 运行次数
    private float jointsNumber; // 关节编号

    // 实例化关节运动代码
    MA_Joint1Contol mA_Joint1Contol;
    MA_Joint2Contol mA_Joint2Contol;
    MA_Joint3Contol mA_Joint3Contol;

    // Start is called before the first frame update
    void Awake()
    {
        mA_Joint1Contol = new MA_Joint1Contol();
    }

    // Update is called once per frame
    void Update()
    {
        // 接收读取与运动的信号，此处接收开始信号
        if(Running_TestPanel_Renew.start_ReadImfor)
        {           
            // 判断第个数组是否赋值，是则继续运行，否则运动结束，发出停止信号
            if(sequenceLenght <= ma_RunningTestPanel.GetComponent<Running_TestPanel_Renew>().i_sequence_front)
            {
                jointsNumber = ma_RunningTestPanel.GetComponent<Running_TestPanel_Renew>().runningSequenceImfor[0,0];
                switch(jointsNumber)
                {
                    case 1:
                    mA_Joint1Contol.MA_Joint1Rotate(ma_RunningTestPanel.GetComponent<Running_TestPanel_Renew>().runningSequenceImfor[0,1]);
                    break;

                }
            }
            else
            // 发出读取与运动的信号，此处为停止信号
            Running_TestPanel_Renew.start_ReadImfor = false;
        }
    }
}
